package com.tbit.main.service.impl;

import com.tbit.main.dao.ter.TerBatteryDao;
import com.tbit.main.pojo.TerBattery;
import com.tbit.main.service.TerBatteryService;
import com.tbit.main.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("terBatteryService")
public class TerBatteryServiceImpl implements TerBatteryService {
    @Autowired
    private TerBatteryDao terBatteryDao;

    @Override
    public TerBattery getByMachineNO(String machineNO) {
        return terBatteryDao.getByMachineNO(machineNO);
    }

    @Override
    public List<TerBattery> getByMachineNOBatch(List<String> machineNOs) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineNOs", StringUtil.getArrayListString(machineNOs));

        return terBatteryDao.getByMachineNOBatch(params);
    }

    @Override
    public List<TerBattery> getAll() {
        return terBatteryDao.getAll();
    }


    @Override
    public List<String> getByBeforeTime(String dt) {
        return terBatteryDao.getByBeforeTime(dt);
    }

    @Override
    public List<String> getNosAfterTimeEU(String machineNOs, String dt, Integer EU) {
        return terBatteryDao.getNosAfterTimeEU(machineNOs, dt, EU);
    }

    @Override
    public List<String> getBatteryEU(Integer EU) {
        return terBatteryDao.getBatteryEU(EU);
    }
}  